package com.lagou.homework1;

public class Manager extends Company {
    // 独有特征 奖金bonus
    private int bonus;

    public Manager(){}
    public Manager(String name, int id, int salary, int bonus){
        super(name, id, salary);
        setBonus(bonus);
        //setName(name);
        //setId(id);
        //setSalary(salary);
    }

    public int getBonus(){
        return bonus;
    }
    public void setBonus(int bonus){
        if(bonus >= 0){
            this.bonus = bonus;
        }
        else{
            System.out.println("奖金不合理！");
        }
    }

    public void work(){
        System.out.println("工号为" + getId() + "基本工资为" + getSalary() +
                "奖金为" + getBonus() + "的项目经理" + getName() + "正在努力的作着管理工作，分配任务，检查员工提交上来的代码...");
    }
}